package com.xinsoft.entity.dto;

import cn.hutool.core.util.ObjectUtil;
import com.xinsoft.entity.vo.ErpProductionFeedingDetailVO;
import com.xinsoft.entity.vo.ErpProductionFeedingVO;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: π
 * 生产计划 ----对应金蝶的 生产任务单
 * */
@Data
public class KisProductionFeedingDetailDto {
    private String  FSourceEntryID;       //源单行号"
    private String  FOrderEntryID;       //订单分录号"
    private String FInterId;         //主表主键
    private String  FEntryID;       //行号" 金蝶子表主键
    private String  FItemID;       //物料代码"
    private String  FMaterielType;       //子项类型"
    private String  FAuxQtyScrap;       //单位用量"
    private String  FQtyScrap;       //基本单位用量",
    private String  FUnitID;       //单位"
    private String  FScrap;       //损耗率(%)"
    private String  FQtyLoss;       //基本单位损耗数量"
    private String  FAuxQtyLoss;       //损耗数量"
    private String  FQtyPick;       //基本单位应发数量"
    private String  FAuxQtyPick;       //应发数量"
    private String  FQtyMust;       //基本单位计划投料数量"
    private String  FAuxQtyMust;       //计划投料数量"
    private String  FQty;       //基本单位选单数量"
    private String  FBOMInPutQTY;       //基本单位标准用量"
    private String  FAuxQty;       //选单数量"
    private String  FStockQty;       //基本单位已领数量"
    private String  FAuxStockQty;       //已领数量"
    private String  FSelDisCardQty;       //报废选单数量"
    private String  FDisCardQty;       //基本单位报废数量"
    private String  FDisCardAuxQty;       //报废数量"
    private String  FBOMInPutAuxQTY;       //标准用量"
    private String  FWIPQty;       //基本单位在制品数量"
    private String  FWIPAuxQty;       //在制品数量"
    private String  FSendItemDate;       //计划发料日期"
    private String  FStockID;       //仓库"
    private String  FSPID;       //仓位"
    private String  FLockFlag;       //锁库标志"
    private String  FBatchNo;       //批号"
    private String  FBackFlush;       //倒冲"
    private String  FOPerID;       //工序"
    private String  FMachinePos;       //工位"
    private String  FMarshalType;       //配置"
    private String  FNote;       //备注"
    private String  FICItemReplaceID;       //替代清单号"
    private String  FQtySupply;       //基本单位补料数量"
    private String  FAuxQtySupply;       //补料数量"
    private String  FOperSN;       //工序号"
    private String  FTransLateQty;       //基本单位调拨数量"
    private String  FTransLateAuxQty;       //调拨数量"
    private String  FSelTransLateQty;       //基本单位调拨选单数量"
    private String  FSelTransLateAuxQty;       //调拨选单数量"
    private String  FChangeTimes;       //变更次数"
    private String  FICMOInterID;       //生产/委外订单内码"
    private String  FBomInterID;       //客户BOM编号"
    private String  FPlanMode;       //计划模式"
    private String  FMTONo;       //计划跟踪号"
    private String  FNeedPickQTY;       //发料平台欠领数量"
    private String  FInvStockQty;       //发料平台库存数量"
    //
//                    "FInterId":"1003",
//                            "FAuxQty":"0.0000000000",
//                            "FAuxQtyLoss":"5.0000000000",
//                            "FAuxQtyMust":"53.0000000000",
//                            "FAuxQtyPick":"53.0000000000",
//                            "FAuxQtyScrap":"2.0000000000",
//                            "FAuxQtySupply":"0.0000000000",
//                            "FAuxStockQty":"0.0000000000",
//                            "FBackFlush":"1059",
//                            "FBatchNo":"",
//                            "FBOMInPutAuxQTY":"48.0000000000",
//                            "FBOMInPutQTY":"48.0000000000",
//                            "FBomInterID":"0",
//                            "FChangeTimes":"0",
//                            "FDisCardAuxQty":"0.0000000000",
//                            "FDisCardQty":"0.0000000000",
//                            "FEntryID":"1",
//                            "FICItemReplaceID":"0",
//                            "FICMOInterID":"1007",
//                            "FInvStockQty":"",
//                            "FItemID":"2567",
//                            "FLockFlag":"0",
//                            "FMachinePos":"",
//                            "FMarshalType":"385",
//                            "FMaterielType":"371",
//                            "FMTONo":"",
//                            "FNeedPickQTY":"",
//                            "FNote":"",
//                            "FOPerID":"0",
//                            "FOperSN":"0",
//                            "FOrderEntryID":"0",
//                            "FPlanMode":"14036",
//                            "FQty":"0.0000000000",
//                            "FQtyLoss":"5.0000000000",
//                            "FQtyMust":"53.0000000000",
//                            "FQtyPick":"53.0000000000",
//                            "FQtyScrap":"2.0000000000",
//                            "FQtySupply":"0.0000000000",
//                            "FScrap":"10.0000000000",
//                            "FSelDisCardQty":"0.0000000000",
//                            "FSelTransLateAuxQty":"0.0000000000",
//                            "FSelTransLateQty":"0.0000000000",
//                            "FSendItemDate":"2011/10/22 0:00:00",
//                            "FSourceEntryID":"0",
//                            "FSPID":"0",
//                            "FStockID":"0",
//                            "FStockQty":"0.0000000000",
//                            "FTransLateAuxQty":"0.0000000000",
//                            "FTransLateQty":"0.0000000000",
//                            "FUnitID":"188",
//                            "FWIPAuxQty":"0.0000000000",
//                            "FWIPQty":"0.0000000000"
    public static ErpProductionFeedingDetailVO voToPo(KisProductionFeedingDetailDto dto) {
        ErpProductionFeedingDetailVO vo = new ErpProductionFeedingDetailVO();
        vo.setId(new Long(dto.getFEntryID()));
        vo.setHeadId(new Long(dto.getFInterId()));
        vo.setMaterialId(new Integer(dto.getFItemID()));
        vo.setBatchNo(dto.getFBatchNo());
        BigDecimal count = new BigDecimal(dto.getFAuxQtyMust());
        vo.setPlanFeeding(count);
        vo.setOutCount(new BigDecimal(dto.getFAuxStockQty()));
        vo.setScrapCount(new BigDecimal(dto.getFDisCardAuxQty()));
        return vo;
    }
}
